04. Additional Cost Considerations
Additional Cost Constraints
Code Snippets
for (int t = 0; t < N-1; ++t) {
cost += pow(delta[t], 2);
}
for (int t = 0; t < N-1; ++t) {
cost += pow(delta[t+1] - delta[t], 2);
cost += pow(a[t+1] - a[t], 2);
}